<template>
  <div class="app-container">
    <div class="left-nav">

      <div class="left-nav-body">

        <div class="left-nav-body-title" @click="windowRead">
            Plum GPT Platform
        </div>

        <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#484c7f"
            text-color="#fff"
            active-text-color="#ffd04b"
        >
          <el-submenu index="1">
            <template slot="title" >
              <i style="margin-left: -65px;" class="el-icon-user"></i>
              <span >用户管理</span>
            </template>
            <el-menu-item-group>
              <router-link  class="router-link-active"  to="/user">
                <el-menu-item index="1-1">用户列表</el-menu-item>
              </router-link>

              <el-menu-item index="1-2">聊天记录</el-menu-item>
              <el-menu-item index="1-3">登录记录</el-menu-item>
              <el-menu-item index="1-4">升级记录</el-menu-item>
            </el-menu-item-group>
          </el-submenu>


          <el-submenu index="2">
            <template slot="title">
              <i style="margin-left: -65px;" class="el-icon-setting"></i>
              <span>系统设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1">字典管理</el-menu-item>
              <el-menu-item index="2-2">角色管理</el-menu-item>
              <el-menu-item index="2-3">操作记录</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="3">
            <template slot="title">
              <i style="margin-left: -65px;" class="el-icon-s-promotion"></i>
              <span>退出系统</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1" @click="loginOut">退出登录</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

        </el-menu>

      </div>

    </div>
    <div class="right-display">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "AppLayout",
  methods:{
    windowRead(){
      window.location.href = "/"
    },
    loginOut(){
      localStorage.removeItem("token")
      location.reload();
    },
  }
};
</script>

<style>
@import './home.css';
</style>
